﻿using System.Runtime.Remoting.Messaging;

namespace GZNest.Repository.Context
{
    public class ContextFactory
    {
        public static GZDbContext GetCurrentContext()
        {
            GZDbContext _nContext = CallContext.GetData("GZDbContext") as GZDbContext;
            if (_nContext == null)
            {
                _nContext = new GZDbContext();
                CallContext.SetData("GZDbContext", _nContext);
            }
            return _nContext;
        }
    }
}
